FROM centos:latest

ADD start.sh start.sh
RUN yum install -y pcre-devel openssl-devel gcc curl wget perl make
RUN cd ~
RUN pwd
RUN wget https://openresty.org/download/openresty-1.15.8.3.tar.gz
RUN tar -xzvf openresty-1.15.8.3.tar.gz \
    && cd openresty-1.15.8.3 \
    && ./configure \
    && gmake \
    && gmake install
RUN PATH=$PATH:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin/
RUN mkdir -p /lua
RUN mkdir -p /usr/local/openresty/nginx/conf/conf.d

EXPOSE 80 443

CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]
